package com.portal.incurridos.persistence.wall;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * @author Alan D�vila
 * e-mail ustargab@gmail.com
 * date 08/11/2013 17:32:03
 */
@Entity
@Table(schema = "app", name = "wall")
@SequenceGenerator(sequenceName = "app.wall_wall_seq", name = "idgen", allocationSize = 1)
public class Wall {

	/**
	 * Identifier.
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "idgen")
	private Integer wall;
	/**
	 * Identifier of project.
	 */
	@Id
	private Integer project;
	/**
	 * Creation date of wall.
	 */
	private Date creationdate;
	/**
	 * Updated wall.
	 */
	private Date lastdate;
	/**
	 * Description of wall.
	 */
	private String description;
	/**
	 * Owner of wall.
	 */
	private String login;
	/**
	 * List of cards.
	 */
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	@JoinColumn(name = "wall")
	private List<Card> cards;
	/**
	 * @return the wall
	 */
	public final Integer getWall() {
		return wall;
	}
	/**
	 * @return the cards
	 */
	public final List<Card> getCards() {
		return cards;
	}
	/**
	 * @param cardsIn the cards to set
	 */
	public final void setCards(final List<Card> cardsIn) {
		this.cards = cardsIn;
	}
	/**
	 * @param wallIn the wall to set
	 */
	public final void setWall(final Integer wallIn) {
		this.wall = wallIn;
	}
	/**
	 * @return the creationDate
	 */
	public final Date getCreationDate() {
		return creationdate;
	}
	/**
	 * @param creationDateIn the creationDate to set
	 */
	public final void setCreationDate(final Date creationDateIn) {
		this.creationdate = creationDateIn;
	}
	/**
	 * @return the lastDate
	 */
	public final Date getLastDate() {
		return lastdate;
	}
	/**
	 * @param lastDateIn the lastDate to set
	 */
	public final void setLastDate(final Date lastDateIn) {
		this.lastdate = lastDateIn;
	}
	/**
	 * @return the description
	 */
	public final String getDescription() {
		return description;
	}
	/**
	 * @param descriptionIn the description to set
	 */
	public final void setDescription(final String descriptionIn) {
		this.description = descriptionIn;
	}
	/**
	 * @return the user
	 */
	public final String getUser() {
		return login;
	}
	/**
	 * @param userIn the user to set
	 */
	public final void setUser(final String userIn) {
		this.login = userIn;
	}
	/**
	 * @return the project
	 */
	public final Integer getProject() {
		return project;
	}
	/**
	 * @param projectIn the project to set
	 */
	public final void setProject(final Integer projectIn) {
		this.project = projectIn;
	}
}
